<template>
	<view class="page">
		<view class="info">
			<icon :type="type" size="68"></icon>
			<text class="msg">{{ msg }}</text>
		</view>

		<view style="width: 60%; margin: 0 auto;">
			<!-- #ifdef MP-WEIXIN -->
			<button type="default" @click="wxBack()">我知道了</button>
			<!-- #endif -->
		</view>
	</view>
</template>

<script setup>
	import {
		getQueryParams
	} from '@/common/utils/index.js'

	const type = ref('')
	const msg = ref('')
	const back = ref('')

	function wxBack() {
		if (back.value === '1') {
			try {
				uni.navigateBack()
			} catch (e) {
				wx.exitMiniProgram()
			}

		} else {
			wx.exitMiniProgram()
		}
	}

	onMounted(() => {
		type.value = getQueryParams('type')
		msg.value = getQueryParams('msg')
		back.value = getQueryParams('back') || '1'
	})
</script>

<style lang="scss" scoped>
	.page {
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		height: 100vh;
		padding: 36px 0 60px;
	}

	.info {
		display: flex;
		flex-direction: column;
		align-items: center;

		.msg {
			font-size: 22px;
			color: #181818;
		}

		icon {
			margin-bottom: 16px;
		}
	}
</style>